package logic

type ImUserSt struct {
	Id      int64  `json:"id"`
	Appid   int    `json:"appid"`
	Userid  int64  `json:"userid"`
	Nick    string `json:"nick"`
	Avatar  string `json:"avatar"`
	Gender  int8   `json:"gender"`
	Regtime int64  `json:"regtime"`
	Role    int8   `json:"role"`
	Expire  int64  `json:"expire"`
	Token   string `json:"token"`
	Lsttime int64  `json:"lsttime"`
	Stime   int64  `json:"stime"`
}

type ImAppSt struct {
	Appid   int64  `json:"appid"`
	Name    string `json:"name"`
	Secret  string `json:"secret"`
	Grpcsrv string `json:"grpcsrv"`
}

type UserSt struct {
	UserId int64  `json:"userid,string"`
	Nick   string `json:"nick"`
	Avatar string `json:"avatar"`
	Gender 	int8  `json:"gender"`
}

type MessageSt struct {
	Type  int16  `json:"type"`	//0-文本 1-图片 2-视频 3-语音
	Text  string `json:"text"`
	Uuid  string `json:"uuid"`
	Stime int64  `json:"stime"`
}

type ImPacketSt struct {
	Uuid string		`json:"uuid"`
	UserId int64	`json:"userid,string"`
	User string		`json:"user"`
	ToUserId int64	`json:"touserid"`
	ToUser string	`json:"touser"`
	TargetId int64	`json:"targetid"`
	Type int16		`json:"type"`
	Message string	`json:"message"`
	Stime int64		`json:"stime"`
}

type ArgsListSt struct {
	Query  string `json:"query"`
	AppId int64   `json:"appid" form:"appid" binding:"required,gt=0"`
	Offset int64  `json:"offset" binding:"gte=0"`
	Limit  int64  `json:"limit" binding:"required,gt=0,lte=50"`
}

type ArgsIdsSliceSt struct {
	AppId int64  `json:"appid" form:"appid" binding:"required,gt=0"`
	Ids []string `json:"ids" binding:"required,min=1"`
}

type ArgsRegTokenSt struct {
	Token string `json:"token" binding:"required,min=1"`
	Agent string `json:"agent" binding:"required,min=1"`
	AppId int64  `json:"appid" binding:"required,gt=0"`
}

type ArgsUserInfo  struct {
	AppId int64  `json:"appid" form:"appid" binding:"required,gt=0"`
	UserId int64  `json:"userid,string" form:"userid,string" binding:"required,gt=1"`
}

type ArgsUserList  struct {
	AppId int64    `json:"appid" form:"appid" binding:"required,gt=0"`
	UserIds []string `json:"userids" form:"userids" binding:"required,min=1"`
}

type ArgsNoSpeak struct {
	AppId int64  `json:"appid" binding:"required,gt=0"`
	UserIds []string `json:"userids" binding:"required,min=1"`
	ExpireAt int64  `json:"expire" binding:"required,gte=0"`
}

type ArgsFilterSt struct {
	AppId int64  `json:"appid" form:"appid" binding:"required,gt=0"`
	ToUserId int64   `json:"touserid,string"`
	ToUser   UserSt  `json:"touser"`
	Remark   string  `json:"remark"`
}

type ArgsConversationSt struct {
	AppId    int64     `json:"appid" form:"appid" binding:"required,gt=0"`
	ToUserId int64     `json:"touserid,string"  binding:"required,gt=0"`
	ToUser   UserSt    `json:"touser"`
	TargetId int64     `json:"targetid,string"`
	Type     int16     `json:"type"`
	Object   string    `json:"object"`
	LastMsg  MessageSt `json:"lstmsg"`
}

type ArgsOfflineMessages struct {
	AppId    int64       `json:"appid" binding:"required,gt=0"`
	UserId   int64       `json:"userid,string"`
	User     UserSt      `json:"user"`
	ToUserId int64       `json:"touserid,string" binding:"required,gt=0"`
	ToUser   UserSt      `json:"touser"`
	TargetId int64       `json:"targetid,string"`
	Type     int16       `json:"type"`
	Messages []MessageSt `json:"messages"`
}

type ArgsMessageListSt struct {
	AppId    int64 `json:"appid" binding:"required,gt=0"`
	MinId  	 int64 `json:"minid,string"`
	ToUserId int64 `json:"touserid,string"`
	Type 	 int8  `json:"type"`
	TargetId int64 `json:"targetid,string"`
}